package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 核算工单对象 main_adjust_order
 *
 * @author qijian
 * @date 2023-02-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("main_adjust_order")
public class AdjustOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "ID")
    private Long id;

    @Excel(name = "单据编号", sort = 1)
    @ApiModelProperty(value = "单据编号")
    private String number;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "来源ID")
    private Long sourceId;

    @Excel(name = "来源类型", sort = 2)
    @ApiModelProperty(value = "来源类型")
    private String sourceType;

    @Excel(name = "开工令/编号", sort = 3)
    @ApiModelProperty(value = "来源编号")
    private String sourceNumber;

    @Excel(name = "产品名称", sort = 4)
    @ApiModelProperty(value = "来源名称")
    private String sourceName;

    @Excel(name = "派工内容", sort = 5)
    @ApiModelProperty(value = "派工内容")
    private String dispatchContent;

    @Excel(name = "派单人", sort = 6)
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    @Excel(name = "作业人", sort = 7)
    @ApiModelProperty(value = "作业人")
    private String taskBy;

    @Excel(name = "工时", sort = 8)
    @ApiModelProperty(value = "工序工时")
    private BigDecimal workTime;

    @Excel(name = "工价", sort = 10)
    @ApiModelProperty(value = "工序工价")
    private BigDecimal workCost;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "派工时间")
    private Date dispatchTime;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "作业人ID")
    private Long taskId;

    @Excel(name = "备注", sort = 12)
    @ApiModelProperty(value = "备注")
    private String remarks;

    @Excel(name = "进度状态", sort = 13)
    @ApiModelProperty(value = "状态(待提交,已提交)")
    private String status;

    @ApiModelProperty(value = "审核者")
    private String approvalBy;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;

    @ApiModelProperty(value = "审核状态")
    private ApprovalDescriptionEnum approvalStatus;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "创建者ID")
    private Long createId;

}
